//
//  ZXStatusDetailView.m
//  ZXOCWeiBo
//
//  Created by mac on 15/12/10.
//  Copyright © 2015年 itcast. All rights reserved.
//

#import "ZXStatusDetailView.h"
#import "ZXStatusOriginalView.h"
#import "ZXStatusRetweetedView.h"

@interface ZXStatusDetailView()

@property(nonatomic,weak)ZXStatusOriginalView* origlView;
@property(nonatomic,weak)ZXStatusRetweetedView * retView;

@end

@implementation ZXStatusDetailView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self.userInteractionEnabled = YES;
       
        self.image =[UIImage resizeImageWithName:@"timeline_card_top_background"];
        //添加原创微博
        ZXStatusOriginalView * origlView = [[ZXStatusOriginalView alloc]init];
        [self addSubview:origlView];
        self.origlView = origlView;
        
        //添加转发微博
        
        ZXStatusRetweetedView * retView = [[ZXStatusRetweetedView alloc]init];
        [self addSubview:retView];
        self.retView = retView;
    }
    
    return self;
}

-(void)setDetailFrm:(ZXStatusDetailFrm *)detailFrm
{
    _detailFrm = detailFrm;
//    设置自身的frm
    self.frame = detailFrm.selfFrm;
//    设置orginalView的orginalFrm
    self.origlView.originalFrm = detailFrm.orginalFrm;
    
//    设置retweedView的frm
    self.retView.retweetedFrm = detailFrm.retweetedFrm;
}
@end
